//
//  supplyInviteController.swift
//  xiaoqiao
//
//  Created by 冷子豪 on 2017/8/9.
//  Copyright © 2017年 冷子豪. All rights reserved.
//

import UIKit

class SupplyInviteController: UIViewController {

    @IBOutlet weak var noteLabel: UILabel!
    @IBOutlet weak var phoneTextField: UITextField!
    @IBOutlet weak var supplyButton: UIButton!
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        let upId = inviteViewModel.getUpGradeByUserId(userid: user.id!)
//        print(upId)
        if upId != 0{
            // upId != 0
            // 存在上线
            noteLabel.text = "已有上线:\(upId)，无需补录！"
            noteLabel.textColor = UIColor.red
            
            phoneTextField.isEnabled = false
            
            supplyButton.isEnabled = false
        }
        // Do any additional setup after loading the view.
    }
    @IBAction func supplyButtonClick(_ sender: UIButton) {
       
        let invitePhone = Int((phoneTextField.text?.trimmingCharacters(in: NSCharacterSet.whitespaces))!)
//        print(invitePhone!)
        _ = navigationController?.popViewController(animated: true)
    }

}
